package org.xiji.fucFactory;

/**
 * 方法工厂模式测试类
 */
public class FucFactoryMain {
    public static void main(String[] args) {
        /**
         * 想要一直猫
         *
         *   猫工厂=====>猫===》叫
         */
        AnimalFactory animalFactory = new CatAnimalFactory();
        Animal cat = animalFactory.createAnimal();
        cat.shout();

        /**
         * 想要一只鱼
         */
        AnimalFactory animalFactory1 = new FishAnimalFactory();
        Animal fish = animalFactory1.createAnimal();
        fish.shout();

    }
}
